//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>

#include "Pratt2PatternsByCATH.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
using namespace std;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
int main (int argc, char** argv) {
  
  String*               namefileCompactPatterns = NULL;
  String*               namefileCATHProfile     = NULL;
  String*               namefileOut             = NULL;

  if (argc < 4) {
    
    cout << "Error in the input parameters! Must by like: " << endl;
    cout << "./GetCondProbabilityPrattPattern <Filename with CATH Profile>";
    cout <<                                 " <Filename with compact Patterns>";
    cout <<                                 " <Filename Out with compact Patterns updated>";
    cout << endl;
    
    return 0;
    
  }
  else {
    
    namefileCATHProfile     = new String(argv[1]);
    namefileCompactPatterns = new String(argv[2]);
    namefileOut             = new String(argv[3]);
    
    cout << "---------------------------------------------------------------------------------" << endl;
    cout << "                 Filename with CATH Profile : " << argv[1] << endl;
    cout << "             Filename with compact Patterns : " << argv[2] << endl;
    cout << " Filename Out with compact Patterns updated : " << argv[3] << endl;
    cout << "---------------------------------------------------------------------------------" << endl;
    
  }
  
  Pratt2PatternsByCATH* pratt2PatternsByCATH = new Pratt2PatternsByCATH ();
  
  cout << "Preparing Files..." << endl;
  pratt2PatternsByCATH->Namefile(namefileCompactPatterns);
  pratt2PatternsByCATH->NamefileOut(namefileOut);
  
  cout << "Loading Files..." << endl;
  pratt2PatternsByCATH->LoadData();
  
  cout << "Writing Compact Pratt2 Pattern File..." << endl;
  pratt2PatternsByCATH->CreateCompactPatternFile();
  
  cout << "Finished..." << endl << "Good Bye" << endl;
  
  if (pratt2PatternsByCATH) delete pratt2PatternsByCATH;
  if (namefileCATHProfile)  delete namefileCATHProfile;
  if (namefileOut)          delete namefileOut;

  return EXIT_SUCCESS;
  
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//

